]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Add a --version command line option
authorFlorian Müllner <fmuellner@src.gnome.org>
Wed, 17 Mar 2010 17:02:24 +0000 (18:02 +0100)
committerFlorian Müllner <fmuellner@src.gnome.org>
Thu, 18 Mar 2010 00:43:11 +0000 (01:43 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=613164

src/Makefile.am
src/gnome-shell.in

index 3d421a82680ae2e3565b86e565240eddc795f382..4fa20a9d367b15d78e0ad83e1d51082e9a61625f 100644 (file)
@@ -18,6 +18,7 @@ gnome-shell: gnome-shell.in
            -e "s|@libdir[@]|$(libdir)|" \
            -e "s|@pkgdatadir[@]|$(pkgdatadir)|" \
            -e "s|@PYTHON[@]|$(PYTHON)|" \
+           -e "s|@VERSION[@]|$(VERSION)|" \
            -e "s|@sysconfdir[@]|$(sysconfdir)|" \
            $< > $@ && chmod a+x $@
 CLEANFILES += gnome-shell
index 36548c58208b5ac7f506e34b07539d275d24ac2c..60a970a7386b000234e7aa801a784962d40f2f8b 100644 (file)
@@ -14,6 +14,10 @@ import termios
 import time
 import errno
 
+def show_version(option, opt_str, value, parser):
+    print "GNOME Shell @VERSION@"
+    sys.exit()
+
 def get_running_session_environs():
     wanted_environment = ['DBUS_SESSION_BUS_ADDRESS', 'DISPLAY', 'XDG_DATA_DIRS',
                           'XAUTHORITY', 'XDG_SESSION_COOKIE', 'ORBIT_SOCKETDIR',
@@ -258,6 +262,8 @@ parser.add_option("", "--eval-file", metavar="EVAL_FILE",
                   help="Evaluate the contents of the given JavaScript file")
 parser.add_option("", "--create-extension", action="store_true",
                   help="Create a new GNOME Shell extension")
+parser.add_option("", "--version", action="callback", callback=show_version,
+                  help="Display version and exit")
 
 options, args = parser.parse_args()